{% extends "base.html" %}
{% block page_title %}Argus: Visitor Map{% endblock %}
{% block load_event %}onload="load()" onunload="GUnload()"{% endblock %}
{% block content %}
  <div id="featured-projects">
    <h4>Weekly #Hijackings (Total: {{ total_stable }}, OA: {{ total_stable_oa }}, AA: {{ total_stable_aa }}, PA: {{ total_stable_pa }})</h4>
    <div id="hijack_container" style="width: 100%"></div>
  </div><!--end featured-projects-->
  <div id="featured-projects">
    <h4>Weekly # Suspicious Hijackings (Total: {{ total_hijack }}, OA: {{ total_hijack_oa }}, AA: {{ total_hijack_aa }}, PA: {{ total_hijack_pa }})</h4>
    <div id="suspicious_container" style="width: 100%"></div>
  </div><!--end featured-projects-->
  <div id="featured-projects">
    <h4>Weekly # Anomalies (Total: {{ total_anomaly }}, OA: {{ total_anomaly_oa }}, AA: {{ total_anomaly_aa }}, PA: {{ total_anomaly_pa }})</h4>
    <div id="anomaly_container" style="width: 100%"></div>
  </div><!--end featured-projects-->
  <!--ipv6-->
  <!--<div id="featured-projects">
    <h4>Weekly #Ipv6 Hijackings (Total: {{ ipv6_stable }}, OA: {{ ipv6_stable_oa }}, AA: {{ ipv6_stable_aa }}, PA: {{ ipv6_stable_pa }})</h4>
    <div id="ipv6_hijack_container" style="width: 100%"></div>
  </div>-->
  <div id="featured-projects">
    <h4>Weekly #IPv6 Suspicious Hijackings (Total: {{ ipv6_hijack }}, OA: {{ ipv6_hijack_oa }}, AA: {{ ipv6_hijack_aa }}, PA: {{ ipv6_hijack_pa }})</h4>
    <div id="ipv6_suspicious_container" style="width: 100%"></div>
  </div>
  <div id="featured-projects">
    <h4>Weekly #IPv6 Anomalies (Total: {{ ipv6_anomaly }}, OA: {{ ipv6_anomaly_oa }}, AA: {{ ipv6_anomaly_aa }}, PA: {{ ipv6_anomaly_pa }})</h4>
    <div id="ipv6_anomaly_container" style="width: 100%"></div>
  </div>
  <!--ipv4-->
  <!--<div id="featured-projects">
    <h4>Weekly #Ipv4 Hijackings (Total: {{ ipv4_stable }}, OA: {{ ipv4_stable_oa }}, AA: {{ ipv4_stable_aa }}, PA: {{ ipv4_stable_pa }})</h4>
    <div id="ipv4_hijack_container" style="width: 100%"></div>
  </div>
  <div id="featured-projects">
    <h4>Weekly #Ipv4  Suspicious Hijackings (Total: {{ ipv4_hijack }}, OA: {{ ipv4_hijack_oa }}, AA: {{ ipv4_hijack_aa }}, PA: {{ ipv4_hijack_pa }})</h4>
    <div id="ipv4_suspicious_container" style="width: 100%"></div>
  </div>
  <div id="featured-projects">
    <h4>Weekly #Ipv4  Anomalies (Total: {{ ipv4_anomaly }}, OA: {{ ipv4_anomaly_oa }}, AA: {{ ipv4_anomaly_aa }}, PA: {{ ipv4_anomaly_pa }})</h4>
    <div id="ipv4_anomaly_container" style="width: 100%"></div>
  </div>-->
{% endblock %}
{% block js_script %}
  <script src="/static/jquery-latest.js"></script>
  <script type="text/javascript" src="/static/highcharts/highcharts.js"></script>
  <script type="text/javascript">
    var hijack_chart;
    var suspicious_chart;
    var anomaly_chart;
	
	var ipv6_hijack_chart;
    var ipv6_suspicious_chart;
    var ipv6_anomaly_chart;
	
	var ipv4_hijack_chart;
    var ipv4_suspicious_chart;
    var ipv4_anomaly_chart;
    $(document).ready(function() {
      hijack_chart = new Highcharts.Chart({
        chart: { renderTo: 'hijack_container', zoomType: 'x', type: 'column' },
        title: { text: 'Weekly #Hijackings' },
        xAxis: {
          title: { text: 'Date' },
          type: 'datetime'
        },
        yAxis: [{
          title: {
            text: '#Hijackings per week',
            //style: { color: '#AA4643' }
          },
          //type: 'logarithmic',
          //minorTickInterval: 'auto'
          type: 'linear',
          min: 0
        }],
        tooltip: {
          shared: true,
          crosshairs: true
        },
        plotOptions: {
          area: {
            stacking: 'normal',
          },
          column: {
            stacking: 'normal',
            minPointLength: 1,
            pointPadding: 0,
            groupPadding: 0,
            borderWidth: 0.1,
            shadow: false
          },
          spline: { marker: { enabled: false, } }
        },
        series: [{
          name: 'OA Hijacking',
          data: [
            {% for h in reportcnts %} {% if h.all_stable_oa %} [{{ h.week }}, {{ h.all_stable_oa }}], {% endif %} {% endfor %}
          ] 
        }, {
          name: 'AA Hijacking',
          data: [
            {% for h in reportcnts %} {% if h.all_stable_aa %} [{{ h.week }}, {{ h.all_stable_aa }}], {% endif %} {% endfor %}
          ] 
        }, {
          name: 'PA Hijacking',
          data: [
            {% for h in reportcnts %} {% if h.all_stable_pa %} [{{ h.week }}, {{ h.all_stable_pa }}], {% endif %} {% endfor %}
          ] 
        }]
      });
      suspicious_chart = new Highcharts.Chart({
        chart: { renderTo: 'suspicious_container', zoomType: 'x', type: 'column' },
        title: { text: 'Weekly # Suspicious Hijackings' },
        xAxis: {
          title: { text: 'Date' },
          type: 'datetime'
        },
        yAxis: [{
          title: {
            text: '# Suspicious hijackings per week',
            //style: { color: '#AA4643' }
          },
          //type: 'logarithmic',
          //minorTickInterval: 'auto'
          type: 'linear',
          min: 0
        }],
        tooltip: {
          shared: true,
          crosshairs: true
        },
        plotOptions: {
          area: {
            stacking: 'normal',
          },
          column: {
            stacking: 'normal',
            minPointLength: 1,
            pointPadding: 0,
            groupPadding: 0,
            borderWidth: 0.1,
            shadow: false
          },
          spline: { marker: { enabled: false, } }
        },
        series: [{
          name: 'OA Suspicious Hijacking',
          data: [
            {% for h in reportcnts %} {% if h.all_hijack_oa %} [{{ h.week }}, {{ h.all_hijack_oa }}], {% endif %} {% endfor %}
          ] 
        }, {
          name: 'AA Suspicious Hijacking',
          data: [
            {% for h in reportcnts %} {% if h.all_hijack_aa %} [{{ h.week }}, {{ h.all_hijack_aa }}], {% endif %} {% endfor %}
          ] 
        }, {
          name: 'PA Suspicious Hijacking',
          data: [
            {% for h in reportcnts %} {% if h.all_hijack_pa %} [{{ h.week }}, {{ h.all_hijack_pa }}], {% endif %} {% endfor %}
          ] 
        }]
      });
      anomaly_chart = new Highcharts.Chart({
        chart: { renderTo: 'anomaly_container', zoomType: 'x', type: 'column' },
        title: { text: 'Weekly # Anomalies' },
        xAxis: {
          title: { text: 'Date' },
          type: 'datetime'
        },
        yAxis: [{
          title: {
            text: '# Anomalies per week',
            //style: { color: '#AA4643' }
          },
          //type: 'logarithmic',
          //minorTickInterval: 'auto'
          type: 'linear',
          min: 0
        }],
        tooltip: {
          shared: true,
          crosshairs: true
        },
        plotOptions: {
          area: {
            stacking: 'normal',
          },
          column: {
            stacking: 'normal',
            minPointLength: 1,
            pointPadding: 0,
            groupPadding: 0,
            borderWidth: 0.1,
            shadow: false
          },
          spline: { marker: { enabled: false, } }
        },
        series: [{
          name: 'OA Anomalies',
          data: [
            {% for h in reportcnts %} {% if h.all_anomaly_oa %} [{{ h.week }}, {{ h.all_anomaly_oa }}], {% endif %} {% endfor %}
          ] 
        }, {
          name: 'AA Anomalies',
          data: [
            {% for h in reportcnts %} {% if h.all_anomaly_aa %} [{{ h.week }}, {{ h.all_anomaly_aa }}], {% endif %} {% endfor %}
          ] 
        }, {
          name: 'PA Anomalies',
          data: [
            {% for h in reportcnts %} {% if h.all_anomaly_pa %} [{{ h.week }}, {{ h.all_anomaly_pa }}], {% endif %} {% endfor %}
          ] 
        }]
      });
	  
      /*ipv6_hijack_chart = new Highcharts.Chart({
        chart: { renderTo: 'ipv6_hijack_container', zoomType: 'x', type: 'column' },
        title: { text: 'Weekly #IPv6 Hijackings' },
        xAxis: {
          title: { text: 'Date' },
          type: 'datetime'
        },
        yAxis: [{
          title: {
            text: '#Hijackings per week',
            //style: { color: '#AA4643' }
          },
          //type: 'logarithmic',
          //minorTickInterval: 'auto'
          type: 'linear',
          min: 0
        }],
        tooltip: {
          shared: true,
          crosshairs: true
        },
        plotOptions: {
          area: {
            stacking: 'normal',
          },
          column: {
            stacking: 'normal',
            minPointLength: 1,
            pointPadding: 0,
            groupPadding: 0,
            borderWidth: 0.1,
            shadow: false
          },
          spline: { marker: { enabled: false, } }
        },
        series: [{
          name: 'OA Hijacking',
          data: [
            {% for h in reportcnts %} {% if h.ipv6_stable_oa %} [{{ h.week }}, {{ h.ipv6_stable_oa }}], {% endif %} {% endfor %}
          ] 
        }, {
          name: 'AA Hijacking',
          data: [
            {% for h in reportcnts %} {% if h.ipv6_stable_aa %} [{{ h.week }}, {{ h.ipv6_stable_aa }}], {% endif %} {% endfor %}
          ] 
        }, {
          name: 'PA Hijacking',
          data: [
            {% for h in reportcnts %} {% if h.ipv6_stable_pa %} [{{ h.week }}, {{ h.ipv6_stable_pa }}], {% endif %} {% endfor %}
          ] 
        }]
      });
	  */
      ipv6_suspicious_chart = new Highcharts.Chart({
        chart: { renderTo: 'ipv6_suspicious_container', zoomType: 'x', type: 'column' },
        title: { text: 'Weekly #IPv6 Suspicious Hijackings' },
        xAxis: {
          title: { text: 'Date' },
          type: 'datetime'
        },
        yAxis: [{
          title: {
            text: '# Suspicious hijackings per week',
            //style: { color: '#AA4643' }
          },
          //type: 'logarithmic',
          //minorTickInterval: 'auto'
          type: 'linear',
          min: 0
        }],
        tooltip: {
          shared: true,
          crosshairs: true
        },
        plotOptions: {
          area: {
            stacking: 'normal',
          },
          column: {
            stacking: 'normal',
            minPointLength: 1,
            pointPadding: 0,
            groupPadding: 0,
            borderWidth: 0.1,
            shadow: false
          },
          spline: { marker: { enabled: false, } }
        },
        series: [{
          name: 'OA Suspicious Hijacking',
          data: [
            {% for h in reportcnts %} {% if h.ipv6_hijack_oa %} [{{ h.week }}, {{ h.ipv6_hijack_oa }}], {% endif %} {% endfor %}
          ] 
        }, {
          name: 'AA Suspicious Hijacking',
          data: [
            {% for h in reportcnts %} {% if h.ipv6_hijack_aa %} [{{ h.week }}, {{ h.ipv6_hijack_aa }}], {% endif %} {% endfor %}
          ] 
        }, {
          name: 'PA Suspicious Hijacking',
          data: [
            {% for h in reportcnts %} {% if h.ipv6_hijack_pa %} [{{ h.week }}, {{ h.ipv6_hijack_pa }}], {% endif %} {% endfor %}
          ] 
        }]
      });
      ipv6_anomaly_chart = new Highcharts.Chart({
        chart: { renderTo: 'ipv6_anomaly_container', zoomType: 'x', type: 'column' },
        title: { text: 'Weekly #IPv6 Anomalies' },
        xAxis: {
          title: { text: 'Date' },
          type: 'datetime'
        },
        yAxis: [{
          title: {
            text: '# Anomalies per week',
            //style: { color: '#AA4643' }
          },
          //type: 'logarithmic',
          //minorTickInterval: 'auto'
          type: 'linear',
          min: 0
        }],
        tooltip: {
          shared: true,
          crosshairs: true
        },
        plotOptions: {
          area: {
            stacking: 'normal',
          },
          column: {
            stacking: 'normal',
            minPointLength: 1,
            pointPadding: 0,
            groupPadding: 0,
            borderWidth: 0.1,
            shadow: false
          },
          spline: { marker: { enabled: false, } }
        },
        series: [{
          name: 'OA Anomalies',
          data: [
            {% for h in reportcnts %} {% if h.ipv6_anomaly_oa %} [{{ h.week }}, {{ h.ipv6_anomaly_oa }}], {% endif %} {% endfor %}
          ] 
        }, {
          name: 'AA Anomalies',
          data: [
            {% for h in reportcnts %} {% if h.ipv6_anomaly_aa %} [{{ h.week }}, {{ h.ipv6_anomaly_aa }}], {% endif %} {% endfor %}
          ] 
        }, {
          name: 'PA Anomalies',
          data: [
            {% for h in reportcnts %} {% if h.ipv6_anomaly_pa %} [{{ h.week }}, {{ h.ipv6_anomaly_pa }}], {% endif %} {% endfor %}
          ] 
        }]
      });
	  
      /*ipv4_hijack_chart = new Highcharts.Chart({
        chart: { renderTo: 'ipv4_hijack_container', zoomType: 'x', type: 'column' },
        title: { text: 'Weekly #Ipv4 Hijackings' },
        xAxis: {
          title: { text: 'Date' },
          type: 'datetime'
        },
        yAxis: [{
          title: {
            text: '#Hijackings per week',
            //style: { color: '#AA4643' }
          },
          //type: 'logarithmic',
          //minorTickInterval: 'auto'
          type: 'linear',
          min: 0
        }],
        tooltip: {
          shared: true,
          crosshairs: true
        },
        plotOptions: {
          area: {
            stacking: 'normal',
          },
          column: {
            stacking: 'normal',
            minPointLength: 1,
            pointPadding: 0,
            groupPadding: 0,
            borderWidth: 0.1,
            shadow: false
          },
          spline: { marker: { enabled: false, } }
        },
        series: [{
          name: 'OA Hijacking',
          data: [
            {% for h in reportcnts %} {% if h.ipv4_stable_oa %} [{{ h.week }}, {{ h.ipv4_stable_oa }}], {% endif %} {% endfor %}
          ] 
        }, {
          name: 'AA Hijacking',
          data: [
            {% for h in reportcnts %} {% if h.ipv4_stable_aa %} [{{ h.week }}, {{ h.ipv4_stable_aa }}], {% endif %} {% endfor %}
          ] 
        }, {
          name: 'PA Hijacking',
          data: [
            {% for h in reportcnts %} {% if h.ipv4_stable_pa %} [{{ h.week }}, {{ h.ipv4_stable_pa }}], {% endif %} {% endfor %}
          ] 
        }]
      });
	  */
      ipv4_suspicious_chart = new Highcharts.Chart({
        chart: { renderTo: 'ipv4_suspicious_container', zoomType: 'x', type: 'column' },
        title: { text: 'Weekly #Ipv4 Suspicious Hijackings' },
        xAxis: {
          title: { text: 'Date' },
          type: 'datetime'
        },
        yAxis: [{
          title: {
            text: '# Suspicious hijackings per week',
            //style: { color: '#AA4643' }
          },
          //type: 'logarithmic',
          //minorTickInterval: 'auto'
          type: 'linear',
          min: 0
        }],
        tooltip: {
          shared: true,
          crosshairs: true
        },
        plotOptions: {
          area: {
            stacking: 'normal',
          },
          column: {
            stacking: 'normal',
            minPointLength: 1,
            pointPadding: 0,
            groupPadding: 0,
            borderWidth: 0.1,
            shadow: false
          },
          spline: { marker: { enabled: false, } }
        },
        series: [{
          name: 'OA Suspicious Hijacking',
          data: [
            {% for h in reportcnts %} {% if h.ipv4_hijack_oa %} [{{ h.week }}, {{ h.ipv4_hijack_oa }}], {% endif %} {% endfor %}
          ] 
        }, {
          name: 'AA Suspicious Hijacking',
          data: [
            {% for h in reportcnts %} {% if h.ipv4_hijack_aa %} [{{ h.week }}, {{ h.ipv4_hijack_aa }}], {% endif %} {% endfor %}
          ] 
        }, {
          name: 'PA Suspicious Hijacking',
          data: [
            {% for h in reportcnts %} {% if h.ipv4_hijack_pa %} [{{ h.week }}, {{ h.ipv4_hijack_pa }}], {% endif %} {% endfor %}
          ] 
        }]
      });
      ipv4_anomaly_chart = new Highcharts.Chart({
        chart: { renderTo: 'ipv4_anomaly_container', zoomType: 'x', type: 'column' },
        title: { text: 'Weekly #Ipv4 Anomalies' },
        xAxis: {
          title: { text: 'Date' },
          type: 'datetime'
        },
        yAxis: [{
          title: {
            text: '# Anomalies per week',
            //style: { color: '#AA4643' }
          },
          //type: 'logarithmic',
          //minorTickInterval: 'auto'
          type: 'linear',
          min: 0
        }],
        tooltip: {
          shared: true,
          crosshairs: true
        },
        plotOptions: {
          area: {
            stacking: 'normal',
          },
          column: {
            stacking: 'normal',
            minPointLength: 1,
            pointPadding: 0,
            groupPadding: 0,
            borderWidth: 0.1,
            shadow: false
          },
          spline: { marker: { enabled: false, } }
        },
        series: [{
          name: 'OA Anomalies',
          data: [
            {% for h in reportcnts %} {% if h.ipv4_anomaly_oa %} [{{ h.week }}, {{ h.ipv4_anomaly_oa }}], {% endif %} {% endfor %}
          ] 
        }, {
          name: 'AA Anomalies',
          data: [
            {% for h in reportcnts %} {% if h.ipv4_anomaly_aa %} [{{ h.week }}, {{ h.ipv4_anomaly_aa }}], {% endif %} {% endfor %}
          ] 
        }, {
          name: 'PA Anomalies',
          data: [
            {% for h in reportcnts %} {% if h.ipv4_anomaly_pa %} [{{ h.week }}, {{ h.ipv4_anomaly_pa }}], {% endif %} {% endfor %}
          ] 
        }]
      });
    });
  </script>
{% endblock %}
